import request from '@/utils/request';

// 用户登录
export function Login(params) {
  return request({
    url: '/cloudApi/auth/jwt',
    method: 'get',
    params
  })
}

// 用户退出登录
export function Logout(params) {
  return request({
    url: '/cloudApi/sys/user/logout',
    method: 'get',
    params
  })
}

// 上传附件
export function PublicUploadFileItem(data) {
  return request({
    url: '/cloudApi/datacenter/file/uploadFile',
    method: 'post',
    data
  })
}

// 上传zip附件
export function PublicUploadFileItemZip(data) {
  return request({
    url: '/cloudApi/datacenter/file/uploadZip',
    method: 'post',
    data
  })
}

// 获取当前登录用户的菜单数据
export function GetCurrentUserRouters(params) {
  return request({
    url: '/cloudApi/sys/menu/getRouters',
    method: 'get',
    params
  })
}

// 获取用户的菜单数据 - 未登录
export function GetCurrentUserRouter(params) {
  return request({
    url: '/cloudApi/sys/menu/getRouter',
    method: 'get',
    params
  })
}

// 获取登录用户的权限按钮
export function GetCurrentUserBtns(params) {
  return request({
    url: '/cloudApi/sys/user/getMenuPerByUserId',
    method: 'get',
    params
  })
}

// 修改密码
export function UpdateUserPassword(data) {
  return request({
      url: '/cloudApi/sys/user/updatePwd',
      method: 'post',
      data
  })
}

// 重置用户密码
export function ResetUserPassword(data) {
  return request({
      url: '/cloudApi/sys/user/resetPwd',
      method: 'post',
      data
  })
}

// 获取当前登录用户对应的商户id
export function GetCurrentUserMchId(params) {
  return request({
    url: '/cloudApi/merchant/merchant/getByUserId',
    method: 'get',
    params
  })
}

// 获取快递的物流信息
export function GetExpressDelivery(params) {
  return request({
    url: '/cloudApi/delivery/getDelivery',
    method: 'get',
    params
  })
}
